{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 决策树的问题"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from sklearn import datasets\n",
    "\n",
    "iris = datasets.load_iris()\n",
    "X = iris.data[:,2:]\n",
    "y = iris.target"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DecisionTreeClassifier(class_weight=None, criterion='entropy', max_depth=2,\n",
       "            max_features=None, max_leaf_nodes=None,\n",
       "            min_impurity_decrease=0.0, min_impurity_split=None,\n",
       "            min_samples_leaf=1, min_samples_split=2,\n",
       "            min_weight_fraction_leaf=0.0, presort=False, random_state=None,\n",
       "            splitter='best')"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.tree import DecisionTreeClassifier\n",
    "\n",
    "tree_clf = DecisionTreeClassifier(max_depth=2, criterion=\"entropy\")\n",
    "tree_clf.fit(X, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def plot_decision_boundary(model, axis):\n",
    "    \n",
    "    x0, x1 = np.meshgrid(\n",
    "        np.linspace(axis[0], axis[1], int((axis[1]-axis[0])*200)).reshape(-1, 1),\n",
    "        np.linspace(axis[2], axis[3], int((axis[3]-axis[2])*200)).reshape(-1, 1),\n",
    "    )\n",
    "    X_new = np.c_[x0.ravel(), x1.ravel()]\n",
    "\n",
    "    y_predict = model.predict(X_new)\n",
    "    zz = y_predict.reshape(x0.shape)\n",
    "\n",
    "    from matplotlib.colors import ListedColormap\n",
    "    custom_cmap = ListedColormap(['#EF9A9A','#FFF59D','#90CAF9'])\n",
    "    \n",
    "    plt.contourf(x0, x1, zz, linewidth=5, cmap=custom_cmap)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAG/1JREFUeJzt3X2QHPV95/H3dx+QYFmxEAkkkLCgrIuNuViK92QOpVxU\ncuaQRAUXZ1JyfHbsckVnH7jgLlVXB7oyD2eH/OU7xfhQ6YAEKg6UMdghQcTYFVV4cMkgyQKDxJV1\n2JwEi5YnSbt6AO3u9/6Y3t3Z3p6dnp6e6Yf5vKqmNP2bX/d8JZW+6u3+zG/M3RERkXLpyroAERFJ\nn5q7iEgJqbmLiJSQmruISAmpuYuIlJCau4hICdVt7mY238yeM7MXzOxlM7s9Yo6Z2V+a2X4ze9HM\nfrc15YqISBw9Mea8D/y+u4+aWS/wjJk94e47quasBVYEj08Cdwe/iohIBuqeuXvFaLDZGzzCn3y6\nBnggmLsDGDCzJemWKiIiccU5c8fMuoFdwIeB77r7z0NTLgAOVG0fDMaGQsfZCGwE6Js37xMrFi9O\nWLYk8c7pv5V1CSLSpAOv7H7b3RfVmxerubv7OLDSzAaAH5rZpe7+UqNFuftWYCvAquXLffumTY0e\nQppw/8o/yboEEWnSTavnvRZnXkNpGXc/DGwHrgq99DqwrGp7aTAmIiIZiJOWWRScsWNmpwOfBl4J\nTXsM+GKQmrkMOOLuQ4iISCbiXJZZAtwfXHfvAr7v7v9gZl8FcPctwDZgHbAfOA58uUX1iohIDHWb\nu7u/CKyKGN9S9dyB69MtTUREktInVEVESkjNXUSkhNTcRURKSM1dRKSE1NxFREpIzV1EpITU3EVE\nSkjNXUSkhNTcRURKSM1dRKSE1NxFREpIzV1EpITU3EVESkjNXUSkhNTcRURKSM1dRKSE1NxFREpI\nzV1EpITU3E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yUvBfY5+7fzrqeRpjZIjMbCJ6fDnwaeCXbquJz95vdfam7L6fyY/U/ufu/z7is2MysL7gJ\nT3A540qgMKkxd38TOGBmvx0M/QGQ+yBBhM+R8SUZaPOqkO1gZg8CVwALzewgcKu735ttVQ1ZA3wB\n+GVw7RrgFnfflmFNcS0B7g+SAl3A9929cHHCAjsP+GHl/IAe4G/d/R+zLalhXwe+F1zaeJV8LGUS\nW/Cf6qeB/5B5LWWLQoqIiC7LiIiUkpq7iEgJqbmLiJSQmruISAmpuYuIlJCau4hICam5i4iU0P8H\nC3FmEqD9n0wAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x116f92a58>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_decision_boundary(tree_clf, axis=[0.5, 7.5, 0, 3])\n",
    "plt.scatter(X[y==0,0], X[y==0,1])\n",
    "plt.scatter(X[y==1,0], X[y==1,1])\n",
    "plt.scatter(X[y==2,0], X[y==2,1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "X_new = np.delete(X, 138, axis=0)\n",
    "y_new = np.delete(y, 138)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(149, 2)"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X_new.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DecisionTreeClassifier(class_weight=None, criterion='entropy', max_depth=2,\n",
       "            max_features=None, max_leaf_nodes=None,\n",
       "            min_impurity_decrease=0.0, min_impurity_split=None,\n",
       "            min_samples_leaf=1, min_samples_split=2,\n",
       "            min_weight_fraction_leaf=0.0, presort=False, random_state=None,\n",
       "            splitter='best')"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tree_clf2 = DecisionTreeClassifier(max_depth=2, criterion=\"entropy\")\n",
    "tree_clf2.fit(X_new, y_new)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAG9lJREFUeJzt3X+QHPWZ3/H3sz9AsFqxEElIIGFBWbHB5AxmIwi6uKi7\nmCCJOlzEpORU7LLr6hQ7QEHiqlTAV4CJfdxfThTjWKUAOVNHoIzBPnKIM+cKdfzwySDJAoNEygSb\nSLDSAmKlXf0A7e6TP6Z3d7a3Z6enp2f6x3xeVVNMf+fbPY9E6dne7s98x9wdEREpl66sCxARkfSp\nuYuIlJCau4hICam5i4iUkJq7iEgJqbmLiJRQ3eZuZgvM7EUze9nMXjOzb0XMMTP7r2b2hpm9Ymaf\naU25IiISR0+MOR8Cf+DuY2bWCzxvZk+5+/aqOeuA1cHjcuAHwX9FRCQDdc/cvWIs2OwNHuFPPl0H\nPBjM3Q4MmNnydEsVEZG44py5Y2bdwE7g48D33f2XoSnnAvuqtvcHY0Oh42wCNgGcclrfZWd/7BMJ\nyxYR6Uz7Xt/1nrsvqTcvVnN39wngEjMbAH5iZhe7+6uNFuXuW4GtAOddeJl/48G/b/QQIiId7dY1\np74VZ15DaRl3HwGeAa4JvfQ2sLJqe0UwJiIiGYiTllkSnLFjZqcBnwNeD017AvhykJq5Ajjs7kOI\niEgm4lyWWQ78MLju3gX8yN3/2sy+BuDuW4BtwHrgDeAY8NUW1SsiIjHUbe7u/gpwacT4lqrnDtyY\nbmkiIpKUPqEqIlJCau4iIiWk5i4iUkJq7iIiJaTmLiJSQmruIiIlpOYuIlJCau4iIiWk5i4iUkJq\n7iIiJaTmLiJSQmruIiIlpOYuIlJCau4iIiW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ZdTyPMbImZDQTPTwM+B7yebVXxuftt\n7r7C3VdR+bX6f7v7v864rNjMrC+4CU9wOeNqoDCpMXc/AOwzs08EQ38I5D5IEOGLZHxJBtq8KmQ7\nmNnDwFXAYjPbD9zp7vdnW1VD1gJfAn4dXLsGuN3dt2VYU1zLgR8GSYEu4EfuXrg4YYGdDfykcn5A\nD/A/3f1vsi2pYTcDDwWXNt4kH0uZxBb8UP0c8G8yr6VsUUgREdFlGRGRUlJzFxEpITV3EZESUnMX\nESkhNXcRkRJScxcRKSE1dxGREvr/buc29RUzAfMAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x11ea8b390>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_decision_boundary(tree_clf2, axis=[0.5, 7.5, 0, 3])\n",
    "plt.scatter(X[y==0,0], X[y==0,1])\n",
    "plt.scatter(X[y==1,0], X[y==1,1])\n",
    "plt.scatter(X[y==2,0], X[y==2,1])\n",
    "plt.show()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
